package com.ruoyi.api.petition.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.petition.domain.LawyerInfo;
import com.ruoyi.petition.service.ILawyerInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 律师信息Controller
 *
 * @author ZWX
 * @date 2025-07-29
 */
@RestController
@RequestMapping("/api/petition/lawyerInfo")
@RequiredArgsConstructor
public class ApiLawyerInfoController extends BaseController {
    private final ILawyerInfoService lawyerInfoService;

    /**
     * 查询律师信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(LawyerInfo lawyerInfo) {
        startPage();
        List<LawyerInfo> list = lawyerInfoService.selectLawyerInfoList(lawyerInfo);
        return getDataTable(list);
    }

    /**
     * 获取律师信息详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(lawyerInfoService.selectLawyerInfoById(id));
    }
}
